﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace JYH.Data
{
    /// <summary>
    /// StandardMapper is the default implementation of IMapper used by PetaJYH
    /// </summary>
    public class StandardMapper : IMapper
    {
        /// <summary>
        /// Constructs a TableInfo for a JYH by reading its attribute data
        /// </summary>
        /// <param name="JYHType">The JYH Type</param>
        /// <returns></returns>
        public TableInfo GetTableInfo(Type JYHType)
        {
            return TableInfo.FromJYH(JYHType);
        }

        /// <summary>
        /// Constructs a ColumnInfo for a JYH property by reading its attribute data
        /// </summary>
        /// <param name="JYHProperty"></param>
        /// <returns></returns>
        public ColumnInfo GetColumnInfo(PropertyInfo JYHProperty)
        {
            return ColumnInfo.FromProperty(JYHProperty);
        }

        public Func<object, object> GetFromDbConverter(PropertyInfo TargetProperty, Type SourceType)
        {
            return null;
        }

        public Func<object, object> GetToDbConverter(PropertyInfo SourceProperty)
        {
            return null;
        }
    }
}
